#include "thread.h"
#include <stdio.h>
#include <stdlib.h>

void *func(void *numero)
{
  int *n = (int *)numero;
  //  printf("j'affiche le numéro %d\n", *n);
  int i=0;
  while(i!=100){
    printf("i::%d, %d\n",*n,i);
    i++;
  }
  
  thread_exit(numero);
  return NULL;

}

int main(){

  thread_t t1, t2;
  int a=42;
  int b=52;
  thread_create(&t1, &func,&a);
  fprintf(stderr, "de retour dans le main\n");
  thread_create(&t2,&func,&b);
  
  thread_join(&t1,NULL);
  thread_join(&t2,NULL);

  fprintf(stderr,"Fin\n");

  return EXIT_SUCCESS;
}
